home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsICacheSession.idl < prev    next >
Text File  |  2006-05-08  |  4KB  |  98 lines

  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is nsICacheSession.idl, released
  17.  * February 23, 2001.
  18.  *
  19.  * The Initial Developer of the Original Code is
  20.  * Netscape Communications Corporation.
  21.  * Portions created by the Initial Developer are Copyright (C) 2001
  22.  * the Initial Developer. All Rights Reserved.
  23.  *
  24.  * Contributor(s):
  25.  *   Gordon Sheridan <gordon@netscape.com>
  26.  *   Patrick Beard   <beard@netscape.com>
  27.  *   Darin Fisher    <darin@netscape.com>
  28.  *
  29.  * Alternatively, the contents of this file may be used under the terms of
  30.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  31.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  32.  * in which case the provisions of the GPL or the LGPL are applicable instead
  33.  * of those above. If you wish to allow use of your version of this file only
  34.  * under the terms of either the GPL or the LGPL, and not to allow others to
  35.  * use your version of this file under the terms of the MPL, indicate your
  36.  * decision by deleting the provisions above and replace them with the notice
  37.  * and other provisions required by the GPL or the LGPL. If you do not delete
  38.  * the provisions above, a recipient may use your version of this file under
  39.  * the terms of any one of the MPL, the GPL or the LGPL.
  40.  *
  41.  * ***** END LICENSE BLOCK ***** */
  42.  
  43. #include "nsISupports.idl"
  44. #include "nsICache.idl"
  45.  
  46. interface nsICacheEntryDescriptor;
  47. interface nsICacheListener;
  48.  
  49. [scriptable, uuid(ae9e84b5-3e2d-457e-8fcd-5bbd2a8b832e)]
  50. interface nsICacheSession : nsISupports
  51. {
  52.     /**
  53.      * Expired entries will be doomed or evicted if this attribute is set to
  54.      * true.  If false, expired entries will be returned (useful for offline-
  55.      * mode and clients, such as HTTP, that can update the valid lifetime of
  56.      * cached content).  This attribute defaults to true.
  57.      */
  58.     attribute PRBool doomEntriesIfExpired;
  59.  
  60.     /**
  61.      * A cache session can only give out one descriptor with WRITE access
  62.      * to a given cache entry at a time.  Until the client calls MarkValid on
  63.      * its descriptor, other attempts to open the same cache entry will block.
  64.      */
  65.  
  66.     /**
  67.      * Synchronous cache access.  This returns a unique descriptor each
  68.      * time it is called, even if the same key is specified.  When
  69.      * called by multiple threads for write access, only one writable
  70.      * descriptor will be granted.  If 'blockingMode' is set to false, it will
  71.      * return NS_ERROR_CACHE_WAIT_FOR_VALIDATION rather than block when another
  72.      * descriptor has been given WRITE access but hasn't validated the entry yet.
  73.      */
  74.     nsICacheEntryDescriptor openCacheEntry(in ACString          key,
  75.                                            in nsCacheAccessMode accessRequested,
  76.                                            in boolean           blockingMode);
  77.  
  78.     /**
  79.      * Asynchronous cache access. Does not block the calling thread.
  80.      * Instead, the listener will be notified when the descriptor is
  81.      * available.
  82.      */
  83.     void asyncOpenCacheEntry(in ACString          key,
  84.                              in nsCacheAccessMode accessRequested,
  85.                              in nsICacheListener  listener);
  86.  
  87.     /**
  88.      * Evict all entries for this session's clientID according to its storagePolicy.
  89.      */
  90.     void evictEntries();
  91.     
  92.     /**
  93.      * Return whether any of the cache devices implied by the session storage policy
  94.      * are currently enabled for instantiation if they don't already exist.
  95.      */
  96.     PRBool isStorageEnabled();
  97. };
  98.